package com.enrollandpay.utils;

import org.apache.commons.lang3.StringUtils;

/**
 * @author 蒋正强
 */
public class CommonUtil
{

    /**
     * 将String按separatorChar分割成Integer[]
     * @param str
     * @param separatorChar
     * @return
     */
    public static Integer[] stringToIntegerArr(final String str, final Character separatorChar)
    {
        Integer[] params = null;
        if (StringUtils.isNotBlank(str))
        {
            String[] stringArr = StringUtils.split(str, separatorChar);
                params = new Integer[stringArr.length];

            for (int i = 0; i < params.length; i++)
                params[i] = Integer.valueOf(stringArr[i]);
        }

        return params;
    }
}
